package org.csmzxy.class2333;

public class Example06 {
    public static void main(String[]args){
        String s = " hello world ";
        //字符串替换操作
        System.out.println("将字符串"+s+"中的world替换成everyone,结果为"+s.replace("world","everyone"));
        //字符串去除空格操作
        System.out.println("去除字符串"+s+"两端的空格,结果为"+s.trim());
        System.out.println("去除字符串"+s+"中所有的空格,结果为"+s.replace(" ",""));
    }
}
